<?php
namespace app\model\question;

use think\Model;

class ZxlKnowStoreQuestionNoteLikeLogModel extends Model
{
    protected $name = 'zxl_know_store_question_note_like_log';

    /**
     * 获取用户是否点赞笔记
     * 
     * @return int
     */
    public static function isLike($note_id, $user_id){
        $isCollect = 0;
        $info = self::where(['note_id' => $note_id, 'user_id' => $user_id])->findOrEmpty();
        if(!$info->isEmpty()) {
            $isCollect = 1;
        }
        return $isCollect;
    }
}